﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using FRL.DebtChased.Silverlight.Library.RichContentService;

namespace FRL.DebtChased.Silverlight.Library
{
    public static class ObjectNoteService
    {
        public delegate void ObjectNoteDisplayRequestEventHandler(object sender, ObjectNoteDisplayRequestEventArgs e);

        public static event ObjectNoteDisplayRequestEventHandler ObjectNoteDisplayRequest;

        public static bool DisplayRequest(object sender, ObservableCollection<AccountNoteTransport> notes)
        {
            return DisplayRequest(sender, string.Empty, notes, ObjectNoteDisplayRequestType.Toggle);
        }
        public static bool DisplayRequest(object sender, string objectDescription, ObservableCollection<AccountNoteTransport> notes, ObjectNoteDisplayRequestType request)
        {
            if (ObjectNoteDisplayRequest != null)
            {
                ObjectNoteDisplayRequest(sender, new ObjectNoteDisplayRequestEventArgs(objectDescription, notes, request));
                return true;
            }
            return false;
        }
    }


    public class ObjectNoteDisplayRequestEventArgs : EventArgs
    {
        public ObjectNoteDisplayRequestType Request { get; set; }

        public string ObjectDescription { get; set; }

        public ObservableCollection<AccountNoteTransport> Notes { get; set; }

        public ObjectNoteDisplayRequestEventArgs(string objectDescription, ObservableCollection<AccountNoteTransport> notes, ObjectNoteDisplayRequestType request)
        {
            this.ObjectDescription = objectDescription;
            this.Notes = notes;
        }
    }

    public enum ObjectNoteDisplayRequestType
    {
        Toggle,
        Show,
        Hide
    }

}

